<?php
global $_GPC, $_W;
$uniacid = $_W['uniacid'];
$id = $_GPC['id'];
$res = $this->res;
$plus = $this->plus;
load()->func('tpl');
$setting = $this->baseset($uniacid);
$settings = $this->module['config'];
$allcate = pdo_fetchall("SELECT * FROM " . tablename($this->tablecate) . " WHERE uniacid = '{$_W['uniacid']} ' AND status=1 order by displayorder desc");
$allcatedtk = pdo_fetchall("SELECT * FROM " . tablename($this->tablecatedtk) . " WHERE uniacid = '{$_W['uniacid']} ' AND status=1 order by displayorder desc");
$indexcate = pdo_fetchall("SELECT * FROM " . tablename($this->tablecate) . " WHERE uniacid = '{$_W['uniacid']} ' AND isindex=1 order by displayorder desc  LIMIT 7");
$indexcatedtk = pdo_fetchall("SELECT * FROM " . tablename($this->tablecatedtk) . " WHERE uniacid = '{$_W['uniacid']} ' AND isindex=1 order by displayorder desc  LIMIT 8");
$show = pdo_fetch("SELECT * FROM " . tablename($this->tableitemdtk) . " WHERE uniacid = '{$_W['uniacid']}' AND id = '{$id}' AND status=1");
$jiage = $show['itemfee'];
$tag = $show['itemyhj_tit'];
if ($tag == '无') {
	$tag = '抢购';
} else {
	$tag = str_replace("", "", $tag);
}
$toptag = $show['itemyhj_tit'];
$yhjetime = strtotime($show['itemyhj_etime']);
$nowtime = time();
if ($nowtime - $yhjetime >= 0) {
	$daoqi = 1;
	$toptag = '抢购';
	$jiagenew = $jiage;
	$ison = 0;
} else {
	$ison = 1;
}
$_share['title'] = $show['title'];
$_share['imgUrl'] = tomedia($show['itempic']);
$_share['desc'] = $show['title'];
$_share['link'] = $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&c=entry&op=yhj&do=show_dtk&m=bsht_tbk&id=" . $show['id'];
$_W['page']['sitename'] = $show['title'];
$pagename = '商品详情';
if ($_W['container'] != 'wechat' && $_W['os'] == 'mobile') {
	$show_none = pdo_fetch("SELECT * FROM " . tablename($this->tableitemdtk) . " WHERE uniacid = '{$_W['uniacid']}' AND id = '{$id}'");
	if ($_GPC['op'] == 'yhj' || $_GPC['op'] == 'share' || $_GPC['op'] == 'view' || empty($_GPC['op'])) {
		$jumpurl = $show_none['itemyhj_url'];
		if (empty($jumpurl)) {
			$jumpurl = $show_none['itemurl'];
		}
		Header('HTTP/1.1 303 See Other');
		Header("Location: $jumpurl");
		exit;
	} else {
		$jumpurl = $show_none['itemyhj_url'];
		Header('HTTP/1.1 303 See Other');
		Header("Location: $jumpurl");
	}
}
include $this->template('show_dtk');